Oracle SQL Revealed by Alex Reprintsev
Author:Alex Reprintsev
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA
At the same time, it can be easily calculated using analytic functions
select id, value, value / first_value(value) over(order by id) ratio from t
Here is a more synthetic example: calculate the ratio between the current row value and the value from the row referenced by ref_id.
exec dbms_random.seed(100);
create table t as
select rownum id,
100 + rownum - 1 value,
trunc(dbms_random.value(1, 10 + 1)) ref_id
from dual
connect by level <= 10;
Model solution is below :
select *
from t
model
dimension by (id)
measures (value, ref_id, 0 ratio)
rules
(
ratio[any] order by id =
round(value[cv(id)] / value[ref_id[cv(id)]], 3)
);
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8310)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6820)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6799)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6684)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6471)
Driving Data Quality with Data Contracts by Andrew Jones(6422)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6172)
Learning SQL by Alan Beaulieu(6005)
Weapons of Math Destruction by Cathy O'Neil(5798)
Big Data Analysis with Python by Ivan Marin(5403)
Data Engineering with dbt by Roberto Zagni(4411)
Solidity Programming Essentials by Ritesh Modi(4058)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3918)
Pandas Cookbook by Theodore Petrou(3621)
Blockchain Basics by Daniel Drescher(3307)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2914)
Feature Store for Machine Learning by Jayanth Kumar M J(2822)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2803)
Mastering Python for Finance by Unknown(2748)
